--[[
require "Task"
require "TaskCategory/RandomTask"
require "WeightPool"

QNW_TS_WealthInDanger = QNW_TS_Task:derive("QNW_TS_WealthInDanger")



local this = QNW_TS_WealthInDanger
this.name = getText("IGUI_QNW_TaskSystem_Task_WealthInDanger_Name")
this.desc = getText("IGUI_QNW_TaskSystem_Task_WealthInDanger_Desc")
this.taskCategory = QNW_TS_RandomTask

function QNW_TS_WealthInDanger:isComplete()
    return self:isTime()
end

function QNW_TS_WealthInDanger:complete()
    if QNW_TS_TaskWindow.instance then
        QNW_TS_TaskWindow.instance:destroy()
    end
    QNW_TS_Task.complete(self)
    local player = getPlayer()
    player:getModData().Counter1 = player:getHoursSurvived()
    caltimeav = 13
    getPlayer():setVariable("runspeed_1", 0.5)
    --getGameTime():  ??
end

function QNW_TS_WealthInDanger:isAbandon()
    return self:isTime()
end

function QNW_TS_WealthInDanger:getProgress()
    return ""
end

function QNW_TS_WealthInDanger:registerClient(_player)
    _player:Say(getText("IGUI_QNW_TaskSystem_Get", self.name))
end

function QNW_TS_WealthInDanger:save()
    local save = {}
    save.Type = self.Type
    save.uuid = self.uuid
    save.time = self.time
    save.rewards = {}
    for k, v in pairs(self.rewards) do
        table.insert(save.rewards, v:save())
    end
    return save
end

function QNW_TS_WealthInDanger:load(_table)
    self.uuid = _table.uuid
    self.time = _table.time
    if _table.rewards then
        self:loadReward(_table.rewards)
    end
end

function QNW_TS_WealthInDanger:new()
    local o = QNW_TS_Task:new()
    setmetatable(o, self)
    self.__index = self

    o.uuid = getRandomUUID()
    o.time = getGameTime():getCalender():getTimeInMillis() + 60 * 60 * 2500  --原60 60 1000

    return o
end

function QNW_TS_WealthInDanger:initReward()
    QNW_TS_ClientCommand.randomReward(self, "height", 1)
end

]]





